$(function () {
    $('.input_sub').on('click', function () {
        let username = $('.input_txt').val()
        let password = $('.input_pass').val()
        $.ajax({
            type: 'post',
            url: 'http://localhost:8080/api/v1/admin/user/login',
            data: { username, password },
            success: function (src) {
                console.log(src);
                if (src.code === 200) {
                    location.href = './index.html'
                    localStorage.setItem('name', src.token)
                } else {
                    alert('密码错误或者账号错误')
                }
            }
        })
    })
})